home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20020314-20021006
/
000385_mswarbrick@rentokil.com_Tue Sep 24 09:14:15 EDT 2002.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
2KB
|
77 lines
Article: 13721 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!panix!bloom-beacon.mit.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
From: mswarbrick@rentokil.com (Mark Swarbrick)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: scripting to a serial sms modem - idiot question!
Date: 24 Sep 2002 04:21:17 -0700
Organization: http://groups.google.com/
Lines: 58
Message-ID: <e516d9ec.0209240321.7d110c63@posting.google.com>
References: <e516d9ec.0209160537.450ca7b@posting.google.com> <am4nq6$p5i$1@watsol.cc.columbia.edu> <e516d9ec.0209180309.320f7dad@posting.google.com> <am9v0g$t1e$1@watsol.cc.columbia.edu> <e516d9ec.0209190043.6a2c8e0d@posting.google.com>
NNTP-Posting-Host: 213.2.60.82
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1032866477 25687 127.0.0.1 (24 Sep 2002 11:21:17 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 24 Sep 2002 11:21:17 GMT
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13721
Hi frank,
I've had some more time to work on the sms project. The basic idea is
to allow someone to text commands to the sms modem eg. 'uptime' and a
text message sent back with the uptime. I've ordered the kermit book,
but could use some help in the meantime with strings.
So far i've added some comment/psudeocode to what i want the script to
do:
---------
#!/usr/bin/kermit
; sets modem init stuff
set line /dev/ttyS0
set speed 9600
set carrier-watch off
set input echo on
lineout at
input 20 ok
lineout AT+CMGF=1
input 20 ok
; queries modem for all messages
lineout at+cmgs=?
input 20 ok
lineout at+cmgl="ALL"
input 100 ok
; Loops msg by message extracting the number and message text into two
strings
; $msg $no
; Depending on the text of the message perform external command which
includes
; modifying the response to fit in 160 chars eg sed / awk etc store
the reply
; in a string called reply_txt
; Execute the send message sms command using $no and $reply_txt
strings
; then loop to next message until there are no more, then delete all
messages
; from the modems memory
---------
Does this sound about right? also how to i run a command and store the
results in a string? in bash i'd just type uptime > uptime.txt. But
can I have a clue how to do it in kermit? Then how to i write that
string to a file?
Many thanks for a pointer in the right direction!
mark